<?php
require_once './config.php' ;
require_once _LIB.'/abstract.php' ;
require_once _LIB.'/mysql.php' ;
require_once _LIB.'/paginate.php' ;
require_once _LIB.'/main.php' ;

if ($_REQUEST["url"]){
	$url = 'movies/'.$_REQUEST["url"];
	$item = mov_get_by_name($_REQUEST["url"]);
}
else {
   $url = 'movies/ad.flv';
   $item = mov_get_by_name('ad.flv');
}
if(!$_REQUEST[o])
	$_REQUEST[o] = 'name';
if(!$_REQUEST[p])
	$_REQUEST[p] = 1 ;
$order = '';
switch($_REQUEST[o]) {
	case 'name' : $order = 'm_name'; break;
	case 'date' : $order = 'm_date DESC'; break;
	case 'size' : $order = 'm_fsize DESC'; break;
} // s w i t c h
$all_cnt = mov_get_db_count();
$pm = paginate($all_cnt ,'p',array('itemsperpage'=> (_DISP_NUM ? _DISP_NUM : 10), 'items'=>10, 'requesttail'=>'&o='.$_REQUEST[o])) ;
$range = $pm->get_range();
$page = mov_get_by_range($range, $order);
$isSubscriber = IsSubscriber();
$nums = $pm->show() ;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Now Watching: <?=$item[1]?></title>
<link rel="stylesheet" type="text/css" href="site.css">
<style>
#flashcontent {
	border: solid 0px #FFF;
	width: 320px;
	height: 310px;
	float: center;
	margin: 0px 0px;
}
</style>
<style type="text/css">
body {
	background-color: #4C4C4C;
	margin: 0;
	padding: 0;
}
body, div, th, td, p {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #FFFFFF;
}
hr {
	height: 1px;
	color: #FFFFFF;
}
</style>
<script type="text/javascript" src="swfobject.js"></script>
<script language="JavaScript">
<!--
function fullwin(targeturl){
window.open(targeturl,"", "scrollbars=yes,resizable=yes,width=640,height=480")
}
//-->
</script>
<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// -->
</script>
</head>

<body>
<table border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td><table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" height="15"><img src="http://flvpowertools.com/phpengine/images/boxround_top_left.jpg" width="15" height="15" alt="" /></td>
        <td height="15" background="http://flvpowertools.com/phpengine/images/boxround_top.jpg"></td>
        <td width="15" height="15"><img src="http://flvpowertools.com/phpengine/images/boxround_top_right.jpg" width="15" height="15" alt="" /></td>
      </tr>
      <tr>
        <td width="15" background="http://flvpowertools.com/phpengine/images/boxround_left.jpg"></td>
        <td height="354" valign="top" background="http://flvpowertools.com/phpengine/images/boxround_center.jpg">

		  <table border="0" cellspacing="0" cellpadding="0">
		    <tr>
		      <td>&nbsp;</td>
              <td valign="top" width="320">

		        <?php /*?><iframe width="340" height="285" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" src="player_files/index.html"></iframe><?php */?>

				<!-- start -->
	<div id="flashcontent">
<strong>You need to upgrade your Flash Player</strong><BR>
		It appears you do not have the Flash 7 plugin or have you have Javascript turned off. Please click <a href="player.php?detectflash=false">this link</a> to <a href="player.php?detectflash=false">bypass the detection</a> if you wish.
	</div>

	<script type="text/javascript">
		// <![CDATA[

		var fo = new SWFObject("system/pass_url_v1.swf", "pass_url_v1", "320", "310", "7", "#FFFFFF");
		//fo.addVariable("url", "http://flvpowertools.com/phpengine/<?=$url?>");
		fo.addVariable("url", "http://nycsportsnews.com/premiumvideo/<?=$url?>");
		fo.addVariable("text", "<?=$item[3]?>");
		//fo.addVariable("flashVarText", "this is passed in via FlashVars for example only"); // this line is optional, but this example uses the variable and displays this text inside the flash movie
		fo.write("flashcontent");

		// ]]>
	</script>
<!-- end -->

<BR>
<B>Now Playing: </B> <font size="2" color="#FFFFFF"><B>

	<?=$item[1]?>

</B></font>

		      </td>
		      <td valign="top">

			     <div style="margin: 10px; width: 300px; height: 300px; overflow: auto; background-color: #41444B; color: #FFFFFF; border: 1px #CCCCCC inset;">

				   <!-----------sortmovies here -->


<?php
if(!empty($page)) {
	//debug($range);
	//echo '<p align=center>'.$nums.'</p>'._E ;
	if (!$isSubscriber)
		echo '<a class="premium" href="/subscribe.htm" target="_parent" style="text-decoration:underline;color:red;"><img src="/images/subscribe.now.video.gif" border="0"/></a><br>';
	echo '<table width="90%" cellpadding="0" cellspacing="0" border="0" frame="void" rules="rows">'._E ;
		for($i=0; $i<count($page); $i++) {
			$clipurl = $page[$i][4];
			if (!$isSubscriber) $clipurl = 'ad.flv'; // teaser video
			echo '<tr>'._E ;
				echo '<td valign=top>'._E ;
					echo '<b>'.($range[$i]+1).'</b>.'._E;
				echo '</td>'._E ;
				echo '<td valign=middle align=top>'._E ;
					echo '<a href="'._ME.'?url='.$clipurl.'&p='.$_REQUEST[p].'&o='.$_REQUEST[o].'" title="Watch now!"><img src="'.($page[$i][2]).'" border="0"></a>'._E ;
				echo '</td>'._E ;
				echo '<td valign=top>'._E ;
					echo '<b>'.($page[$i][1]).'</b><br>'._E ;
					echo ''.nl2br($page[$i][6]).'<br>'._E ;
				echo '<hr></td>'._E ;
			echo '</tr>'._E ;
		} // f o r
	echo '</table>'._E ;
	echo '<center>'.$nums.'</center>'._E ;
} // i f
else {
	echo 'Nothing to watch!' ;
} // e l s e
?>

				   <CENTER>Sort movies by
		<b><a href='<?=_ME?>?o=name'>name</a></b>,
		<b><a href="<?=_ME?>?o=date">date</a></b>





				   <?php /*?><table width="90%" border="0" cellspacing="0" cellpadding="2" align="center">
                        <tr>
                          <td width="75"><img src="http://flvpowertools.com/phpengine/images/pic1.jpg" width="71" height="54" /></td>
                          <td>World leaders hammer out plan to deal with Iran's nuclear program </td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                        <tr>
                          <td><img src="http://flvpowertools.com/phpengine/images/pic2.jpg" width="71" height="54" /></td>
                          <td>World leaders hammer out plan to deal with Iran's nuclear program </td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                        <tr>
                          <td><img src="http://flvpowertools.com/phpengine/images/pic3.jpg" width="71" height="54" /></td>
                          <td>World leaders hammer out plan to deal with Iran's nuclear program </td>
                        </tr>
						<tr>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
						<tr>
                          <td width="75"><img src="http://flvpowertools.com/phpengine/images/pic1.jpg" width="71" height="54" /></td>
                          <td>World leaders hammer out plan to deal with Iran's nuclear program </td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                        <tr>
                          <td><img src="http://flvpowertools.com/phpengine/images/pic2.jpg" width="71" height="54" /></td>
                          <td> </td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                        <tr>
                          <td><img src="http://flvpowertools.com/phpengine/images/pic3.jpg" width="71" height="54" /></td>
                          <td> </td>
                        </tr>
                      </table><?php */?>
			        </div>

			  </td>
		    </tr>
		  </table>

		</td>
        <td width="15" background="http://flvpowertools.com/phpengine/images/boxround_right.jpg"></td>
      </tr>
      <tr>
        <td><img src="http://flvpowertools.com/phpengine/images/boxround_bottom_left.jpg" width="15" height="15" alt="" /></td>
        <td background="http://flvpowertools.com/phpengine/images/boxround_bottom.jpg"></td>
        <td><img src="http://flvpowertools.com/phpengine/images/boxround_bottom_right.jpg" width="15" height="15" alt="" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
